
<template>
  <div class="Investmentdetails">
    <van-nav-bar @click-left="onClickLeft" title="投资详情" :left-arrow="true" />
    <div class="header">
      <h3>【新手专享】汽车电池研发生产项目</h3>
      <div class="banner">
        <img src="@/assets/img/project/banner.png" />
        <img class="icon" src="@/assets/img/project/xiaoshouzhuanxiang.png" />
      </div>
      <div class="column">
        <div class="columnSub">
          <p class="num">
            900.00
            <span>万元</span>
          </p>
          <p class="name">项目规模</p>
        </div>
        <div class="columnSub">
          <p class="num">
            2.00
            <span>元起</span>
          </p>
          <p class="name">每期分红</p>
        </div>
        <div class="columnSub">
          <p class="num">
            1
            <span>天</span>
          </p>
          <p class="name">投资期限</p>
        </div>
      </div>
      <div class="jindu">
        <div class="progressbox">
          <div class="progress">
            <span>72%</span>
          </div>
        </div>
      </div>
    </div>
    <div class="mode">
      <div class="modular">
        <div class="modularsub">
          <img class="icon1" src="@/assets/img/project/fenhong.png" />
          <div class="content">
            <p>分红方式</p>
            <span>每天返息，到期还本</span>
          </div>
        </div>
        <div class="modularsub">
          <img class="icon2" src="@/assets/img/project/anquan.png" />
          <div class="content">
            <p>投资零风险</p>
            <span>本金保障</span>
          </div>
        </div>
      </div>
      <div class="modular">
        <div class="modularsub">
          <img class="icon3" src="@/assets/img/project/jine.png" />
          <div class="content">
            <p>起投金额</p>
            <span>200.00元</span>
          </div>
        </div>
        <div class="modularsub">
          <img class="icon4" src="@/assets/img/project/jigou.png" />
          <div class="content">
            <p>担保机构</p>
            <span>中国太平洋保险(集团)股份有限公司</span>
          </div>
        </div>
      </div>
    </div>
    <div class="detail">
      <div class="title">项目投资详情</div>
      <van-steps direction="vertical" :active="-1" inactive="#8CABFF">
        <van-step v-if="index<(open?'5':list.length)" v-for="(item,index) in list" :key="index">
          <div class="step">
            <div class="title">{{item.name}}</div>
            <div class="main">{{item.value}}</div>
          </div>
        </van-step>
      </van-steps>
      <div class="open" @click="open=!open">
        {{open?'展开':'收起'}}
        <van-icon v-if="open" name="arrow-down" />
        <van-icon v-else name="arrow-up" />
      </div>
    </div>
    <div style="height:50px;"></div>
    <div class="footer">
      <van-button class="play" type="primary">马上投资</van-button>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    name: "project",
  },
  data() {
    //这里存放数据
    return {
      open: true,
      list: [
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
        {
          name: "项目名称",
          value: "果业种植基地项目【新手体验项目】",
        },
      ],
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    onClickLeft() {
      this.$router.push({
        //核心语句
        path: "/project", //跳转的路径
        // query: {
        //   //路由传参时push和query搭配使用 ，作用时传递参数
        //   id: this.id,
        // },
      });
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped lang="less">
.Investmentdetails {
  width: 100%;
  height: 100%;
  background: #f7f8f9;
  overflow-y: auto;

  .header {
    padding: 8px 20px;
    background: #ffffff;
    margin-top: 5px;
    h3 {
      font-size: 15px;
      font-family: PingFangSC, PingFangSC-Medium;
      font-weight: 500;
      text-align: left;
      color: #20253a;
      line-height: 21px;
      letter-spacing: -1px;
    }
    .banner {
      margin: 10px 0;
      position: relative;

      img {
        width: 100%;
        height: 100%;
      }
      .icon {
        width: 51px;
        height: 22px;
        position: absolute;
        top: -8px;
        left: 0px;
      }
    }
    .column {
      display: flex;
      margin: 10px 0;
      .columnSub {
        flex: 1;
        text-align: center;
        .num {
          font-size: 15px;
          font-family: DINPro, DINPro-Medium;
          font-weight: 500;
          color: #3b0c07;
          span {
            font-size: 10px;
            font-family: PingFangSC, PingFangSC-Semibold;
            font-weight: 600;
            color: #3f3f3f;
          }
        }
        .name {
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          color: #aaaaaa;
          margin-top: 6px;
        }
      }
    }
    .jindu {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      margin: 25px 0 15px 0;
      .progressbox {
        width: calc(100% - 5px);
        height: 5px;
        background: #fef2f2;
        border-radius: 3px;
        position: relative;
        text-align: center;

        .progress {
          width: 70%;
          position: absolute;
          left: 0;
          top: 0;
          height: 5px;
          background: #ff674c;
          border-radius: 3px;
          span {
            position: absolute;
            display: block;
            width: 43px;
            height: 20px;
            background: linear-gradient(180deg, #ff3927, #ff6b4f 133%);
            border-radius: 12px;
            text-align: center;
            line-height: 20px;
            font-size: 15px;
            font-family: PingFangSC, PingFangSC-Medium;
            font-weight: 500;
            color: #ffffff;
            right: -40px;
            top: -8px;
          }
        }
      }
    }
  }
  .mode {
    padding: 0px 10px;
    background: #ffffff;
    margin-top: 10px;
    .modular {
      display: flex;
      border-bottom: 1px solid #f5f5f5;
      .modularsub {
        flex: 1;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 17px 10px;

        .content {
          margin-left: 14px;

          p {
            font-size: 14px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: left;
            color: #333333;
            margin-bottom: 5px;
          }
          span {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: left;
            color: #b2b3b4;
          }
        }
      }
      .icon1 {
        width: 18px;
        height: 18px;
      }
      .icon2 {
        width: 17px;
        height: 20px;
      }
      .icon3 {
        width: 18px;
        height: 20px;
      }
      .icon4 {
        width: 17px;
        height: 20px;
      }
    }
    .modular:nth-child(2) {
      border-bottom: none;
    }
  }
  .detail {
    padding: 17px 10px;
    background: #ffffff;
    margin-top: 5px;

    .title {
      font-size: 18px;
      font-family: PingFangSC, PingFangSC-Medium;
      font-weight: 500;
      text-align: left;
      color: #202020;
    }
    .step {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: flex-start;
      .title {
        width: 25%;
        font-size: 14px;
        font-family: PingFangSC, PingFangSC-Regular;
        font-weight: 400;
        text-align: left;
        color: #333333;
      }
      .main {
        width: 75%;
        font-size: 14px;
        font-family: PingFangSC, PingFangSC-Regular;
        font-weight: 400;
        text-align: left;
        color: #b2b3b4;
      }
    }
    /deep/.van-step {
      padding: 12px 0;
    }
    /deep/.van-step--vertical:not(:last-child)::after {
      border-bottom-width: 0;
    }
    /deep/.van-step__line {
      background-color: #8cabff;
    }
    /deep/.van-step__circle {
      width: 5px;
      height: 5px;
      background: #ffffff;
      border: 1px solid #8cabff;
    }
    .open {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: center;
      padding: 10px 0;
      color: #999999;
    }
  }
  .footer {
    // background: #f7f8f9;
    background: #ffffff;
    padding: 10px 0px;
    text-align: center;
    position: fixed;
    width: 100%;
    z-index: 99;
    bottom: 0;
    .play {
      width: calc(100% - 40px);
      font-size: 17px;
      font-family: PingFangSC, PingFangSC-Medium;
      font-weight: 500;
      text-align: center;
      color: #ffffff;
      background: linear-gradient(180deg, #ff3927, #ff6b4f 133%);
      border-radius: 5px;
      box-shadow: 0px 2px 4px 0px #ffd9d4;
      border: none;
    }
  }
}
/* //@import url(); 引入公共css类 */
</style>